<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qpaintdevicewindow.cpp -->
  <title>QPaintDeviceWindow Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QPaintDeviceWindow</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QPaintDeviceWindow Class</h1>
<!-- $$$QPaintDeviceWindow-brief -->
<p>Convenience subclass of <a href="qwindow.html">QWindow</a> that is also a <a href="qpaintdevice.html">QPaintDevice</a>. <a href="#details">More...</a></p>
<!-- @@@QPaintDeviceWindow -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QPaintDeviceWindow&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.4</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qwindow.html">QWindow</a> and <a href="qpaintdevice.html">QPaintDevice</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qopenglwindow.html">QOpenGLWindow</a> and <a href="qrasterwindow.html">QRasterWindow</a></p>
</td></tr></table></div><p>This class was introduced in Qt 5.4.</p>
<ul>
<li><a href="qpaintdevicewindow-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpaintdevicewindow.html#update">update</a></b>(const QRect &amp;<i>rect</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpaintdevicewindow.html#update-1">update</a></b>(const QRegion &amp;<i>region</i>)</td></tr>
</table></div>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpaintdevicewindow.html#update-2">update</a></b>()</td></tr>
</table></div>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintdevicewindow.html#paintEvent">paintEvent</a></b>(QPaintEvent *<i>event</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QPaintDeviceWindow-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>QPaintDeviceWindow is like a regular <a href="qwindow.html">QWindow</a>, with the added functionality of being a paint device too. Whenever the content needs to be updated, the virtual <a href="qpaintdevicewindow.html#paintEvent">paintEvent</a>() function is called. Subclasses, that reimplement this function, can then simply open a <a href="qpainter.html">QPainter</a> on the window.</p>
<p><b>Note: </b>This class cannot directly be used in applications. It rather serves as a base for subclasses like <a href="qopenglwindow.html">QOpenGLWindow</a>.</p></div>
<p><b>See also </b><a href="qopenglwindow.html">QOpenGLWindow</a>.</p>
<!-- @@@QPaintDeviceWindow -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$update$$$update -->
<h3 class="fn" id="update-2"><a name="update-2"></a><code>[slot] </code><span class="type">void</span> QPaintDeviceWindow::<span class="name">update</span>()</h3>
<p>Marks the entire window as dirty and schedules a repaint.</p>
<p><b>Note: </b>Subsequent calls to this function before the next paint event will get ignored.</p><p><b>Note: </b>For non-exposed windows the update is deferred until the window becomes exposed again.</p><!-- @@@update -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn" id="paintEvent"><a name="paintEvent"></a><code>[virtual protected] </code><span class="type">void</span> QPaintDeviceWindow::<span class="name">paintEvent</span>(<span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> *<i>event</i>)</h3>
<p>Handles paint events passed in the <i>event</i> parameter.</p>
<p>The default implementation does nothing. Reimplement this function to perform painting. If necessary, the dirty area is retrievable from the <i>event</i>.</p>
<!-- @@@paintEvent -->
<!-- $$$update[overload1]$$$updateconstQRect& -->
<h3 class="fn" id="update"><a name="update"></a><span class="type">void</span> QPaintDeviceWindow::<span class="name">update</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>)</h3>
<p>Marks the <i>rect</i> of the window as dirty and schedules a repaint.</p>
<p><b>Note: </b>Subsequent calls to this function before the next paint event will get ignored, but <i>rect</i> is added to the region to update.</p><p><b>Note: </b>For non-exposed windows the update is deferred until the window becomes exposed again.</p><!-- @@@update -->
<!-- $$$update$$$updateconstQRegion& -->
<h3 class="fn" id="update-1"><a name="update-1"></a><span class="type">void</span> QPaintDeviceWindow::<span class="name">update</span>(const <span class="type"><a href="qregion.html">QRegion</a></span> &amp;<i>region</i>)</h3>
<p>Marks the <i>region</i> of the window as dirty and schedules a repaint.</p>
<p><b>Note: </b>Subsequent calls to this function before the next paint event will get ignored, but <i>region</i> is added to the region to update.</p><p><b>Note: </b>For non-exposed windows the update is deferred until the window becomes exposed again.</p><!-- @@@update -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
